
<head>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
    <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
    <%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
</head>
<script type="text/javascript"> 
    var status="${status}";
    function retireAction(submitAction) {
        afterSubmitRedirect("question", "retire.html", submitAction, "submitAction");
    }
    function ShowResponse(){
        var div_radiobutton = document.getElementById("div_radiobutton");
        var div_none = document.getElementById("div_none");
        var div_textarea = document.getElementById("div_textarea");
        var div_checkbox = document.getElementById("div_checkbox");
        var div_string = document.getElementById("div_string");
        var div_float = document.getElementById("div_float");
        var div_date = document.getElementById("div_date");
        var div_custom = document.getElementById("div_custom");
        var div_dynamic = document.getElementById("div_dynamic");
        var div_dropdown = document.getElementById("div_dropdown");
        var div_int = document.getElementById("div_int");
        var TypeName = "${responseName}";

        if (TypeName=="Please Select" || TypeName=="Yes/No" || TypeName=="No/Yes" || TypeName=="Social Security Number" || TypeName==" Phone Number" || TypeName=="Email Address" || TypeName=="US States" ){
            div_custom.style.display="none";
            div_dynamic.style.display="none";
            div_radiobutton.style.display="none";
            div_none.style.display="none";
            div_textarea.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_float.style.display="none";
            div_date.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";
        }
        if (TypeName=="Custom"){
            //check exist session response type, if exist then delete it
            div_custom.style.display="";
            div_dynamic.style.display="none";
            div_radiobutton.style.display="none";
            div_none.style.display="none";
            div_textarea.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_float.style.display="none";
            div_date.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";
        }
        if (TypeName=="Dynamic"){
            div_dynamic.style.display="";
            div_custom.style.display="none";
            div_radiobutton.style.display="none";
            div_none.style.display="none";
            div_textarea.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_float.style.display="none";
            div_date.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";
        }
        //----------
        var uiControlName = "${uiControlName}";
        var dateTypeName = "${dateTypeName}";
        if (uiControlName=="Radio Button"){
            div_radiobutton.style.display="";
            div_none.style.display="none";
            div_textarea.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_float.style.display="none";
            div_date.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";

        }
        if (uiControlName=="Dropdown"){
            div_dropdown.style.display="";
            div_radiobutton.style.display="none";
            div_none.style.display="none";
            div_textarea.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_float.style.display="none";
            div_date.style.display="none";
            div_int.style.display="none";
        }
        if (uiControlName=="Check Box"){
            div_checkbox.style.display="";
            div_none.style.display="none";
            div_textarea.style.display="none";
            div_radiobutton.style.display="none";
            div_string.style.display="none";
            div_float.style.display="none";
            div_date.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";
        }
        if (uiControlName=="Please Select" || TypeName=="Text Box" || TypeName=="Text Area"){
            div_date.style.display="none";
            div_radiobutton.style.display="none";
            div_textarea.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_float.style.display="none";
            div_none.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";
        }
        //-----
        if ((uiControlName=="Text Box" && dateTypeName=="Boolean") || (uiControlName=="Text Box" && dateTypeName=="Boolean")){
            div_date.style.display="none";
            div_radiobutton.style.display="none";
            div_textarea.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_float.style.display="none";
            div_none.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";
        }
        if ((uiControlName == "Text Box" && dateTypeName=="String") || (uiControlName == "Text Area" && dateTypeName=="Date") ||  (uiControlName == "Text Area" && TypeName=="Float")){
            div_date.style.display="none";
            div_radiobutton.style.display="none";
            div_textarea.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_float.style.display="none";
            div_none.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";
        }
        if (uiControlName == "Text Box" && dateTypeName=="Date"){
            div_date.style.display="";
            div_radiobutton.style.display="none";
            div_textarea.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_float.style.display="none";
            div_none.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";
        }
        if (uiControlName == "Text Area" && dateTypeName=="String"){
            div_textarea.style.display="";
            div_radiobutton.style.display="none";
            div_date.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_float.style.display="none";
            div_none.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";
        }
        if (uiControlName == "Text Box" && dateTypeName=="String"){
            div_string.style.display="";
            div_radiobutton.style.display="none";
            div_textarea.style.display="none";
            div_checkbox.style.display="none";
            div_date.style.display="none";
            div_float.style.display="none";
            div_none.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";
        }
        if (uiControlName == "Text Box" && dateTypeName=="Float"){
            div_float.style.display="";
            div_radiobutton.style.display="none";
            div_date.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_textarea.style.display="none";
            div_none.style.display="none";
            div_dropdown.style.display="none";
            div_int.style.display="none";
        }
        if (uiControlName == "Text Box" && dateTypeName=="Integer"){
            div_int.style.display="";
            div_float.style.display="none";
            div_radiobutton.style.display="none";
            div_date.style.display="none";
            div_checkbox.style.display="none";
            div_string.style.display="none";
            div_textarea.style.display="none";
            div_none.style.display="none";
            div_dropdown.style.display="none";
        }

    }
</script>
<body onload="ShowResponse();">
    <!-- Menu -->
    <jsp:include page="menu.jsp" />
    <!--START: Subnav -->
    <div class="sub_nav">
        <ul>
            <li><a href="#"><img src="<%= request.getContextPath()%>/images/menu/sub_general_on.gif" width="114" height="18" alt="gernal" /></a></li>

        </ul>
    </div>
    <!--END: Subnav -->
    <!--START: conent -->
    <div class="content2">
        <div class="insider">
            <div class="corners">
                <div class="corners_top"></div>
                <div class="column1">
                    <div class="col_l">
                        <table width="440" border="0" cellspacing="4" class="formlayout_table">
                            <tr>
                                <th width="188"><label><spring:message code="question.id" />:</label></th>
                                <td width="240">${question.refId}</td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="question.version" />:</label></th>
                                <td>${question.version}<br /></td>
                            </tr>
                            <tr>
                                <th><label>Name:</label></th>
                                <td>${question.name}</td>
                            </tr>
                            <tr>
                                <th><label>Vocabulary Name:</label></th>
                                <td>${question.vocabularyname}</td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="question.text" />:</label></th>
                                <td>${question.text}</td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="question.description" /></label></th>
                                <td>${question.description}</td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="question.helptext" />:</label></th>
                                <td>${question.helpText}</td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="question.responsetype" />:</label></th>
                                <td>
                                ${responseName}</td>
                            </tr>
                        </table>
                    </div>
                    <form id="question" method="post">
                        <input type="hidden" id="submitAction" name="submitAction" />
                        <table width="282" border="0" cellspacing="4" class="formlayout_table fr">
                            <tr>
                                <th width="159"><label><spring:message code="question.siblingid" />:</label></th>
                                <td width="111">&nbsp;</td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="question.siblingversion" />:</label></th>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="question.status" />:</label></th>
                                <td>${question.questionStatusType.code}</td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="question.availability" />:</label></th>
                                <td>${question.questionAvailabilityType.code}</td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="application.lastmodifieddate" />:</label></th>
                                <td><fmt:formatDate value="${question.modifiedOn}" pattern="dd-MMM-yyyy" /></td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="application.lastmodifiedby" />:</label></th>
                                <td>${question.modifiedBy.username}</td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        <spring:message code="question.retiredby" />:
                                    </label>
                                </th>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        <spring:message code="question.retireddate" />:
                                    </label>
                                </th>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="question.retirednotes" />:</label></th>
                                <td><textarea name="retiredNote" id="retiredNote" style="width:110px;height:3em;padding:1px 3px;" onkeypress="if(this.value.length >=255) return false;" onpaste="if(this.value.length >=255) return false;">${question.retiredNote}</textarea></td>
                            </tr>
                        </table>
                    </form>
                    <div id="div_custom" style="display:none;">
                        <table width="750" border="0" cellspacing="4" class="formlayout_table cb">
                            <tr>
                                <th width="190"><label>UI Control:</label></th>
                                <td width="270">
                                    ${uiControlName}
                                </td>
                                <th width="160"><label>Data Type:</label></th>
                                <td width="110">
                                    ${dateTypeName}
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="div_dynamic" style="display:none;">
                        <table width="750" border="0" cellspacing="4" class="formlayout_table cb">
                            <tr>
                                <th width="190"><label>UI Control:</label></th>
                                <td width="270">
                                    ${uiControlName}
                                </td>
                                <th width="160"><label>Data Type:</label></th>
                                <td width="110">
                                    ${dateTypeName}
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="div_none" style="display:none;">

                    </div>
                    <div id="div_checkbox" style="display:none;">
                        <table width="750" border="0" cellspacing="4" class="formlayout_table cb">
                            <tr>
                                <th>&nbsp;</th>
                                <td class="response_type_check"><dl class="edit">
                                        <c:forEach var="lresponseEntity" items="${lresponseEntity}">
                                            <dd><div><strong>${lresponseEntity.label}</strong><em>${lresponseEntity.value}</em></div></dd>

                                        </c:forEach>
                                </dl></td>
                            </tr>
                            <tr>
                                <th><label>Entries:</label></th>
                                <td>${entitys}</td>
                            </tr>
                            <tr>
                                <th width="190"><label>Max Selections:</label></th>
                                <td width="543">${question.maxResponses}</td>
                            </tr>
                        </table>
                    </div>
                    <div id="div_radiobutton" style="display:none;">
                        <table width="750" border="0" cellspacing="4" class="formlayout_table cb">
                            <tr>
                                <th width="190">&nbsp;</th>
                                <td class="response_type"><dl class="edit">
                                        <c:forEach var="lresponseEntity" items="${lresponseEntity}">

                                            <dd><div><strong>${lresponseEntity.label}</strong><em>${lresponseEntity.value}</em></div></dd>
                                        </c:forEach>
                                </dl></td>
                            </tr>

                            <tr>
                                <th><label>Entries:</label></th>
                                <td>${entitys}</td>
                            </tr>
                        </table>
                    </div>
                    <div id="div_dropdown" style="display:none;">
                        <table width="750" border="0" cellspacing="4" class="formlayout_table cb">
                            <tr>
                                <th width="190">&nbsp;</th>
                                <td class="response_type_dropdown"><dl class="edit">
                                        <c:forEach var="lresponseEntity" items="${lresponseEntity}">
                                            <dd><div><strong>${lresponseEntity.label}</strong><em>${lresponseEntity.value}</em></div></dd>

                                        </c:forEach>
                                </dl></td>
                            </tr>
                            <tr>
                                <th><label>Entries:</label></th>
                                <td>${entitys}</td>
                            </tr>
                        </table>
                    </div>
                    <div id="div_textarea" style="display:none;">
                        <table width="750" border="0" cellspacing="4" class="formlayout_table">
                            <tr>
                                <th width="190"><label>Columns:</label></th>
                                <td width="543">${question.width}</td>
                            </tr>
                            <tr>
                                <th><label>Rows:</label></th>
                                <td>${question.rows}</td>
                            </tr>
                            <tr>
                                <th><label>Minimum Chars:</label></th>
                                <td>${question.minResponseValue}</td>
                            </tr>
                            <tr>
                                <th><label>Maximum Chars:</label></th>
                                <td>${question.maxResponseValue}</td>
                            </tr>
                            <tr>
                                <th><label>Edit Mask:</label></th>
                                <td>${mask}
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="div_string" style="display:none;">
                        <table width="750" border="0" cellspacing="4" class="formlayout_table">
                              <tr>
                                    <th width="190"><label>Width(in pixels):</label></th>
                                    <td width="543">${question.width}</td>
                                </tr>
                                <tr>
                                    <th><label>Minimum Chars:</label></th>
                                    <td>${question.maxResponseValue}</td>
                                </tr>
                                <tr>
                                    <th><label>Maximum Chars:</label></th>
                                    <td>${question.minResponseValue}</td>
                                </tr>
                            <tr>
                                <th width="190"><label>Units:</label></th>
                                <td width="543">
                                    ${units}
                                </td>
                            </tr>
                            <tr>
                                <th><label>Edit Mask:</label></th>
                                <td>${mask}
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="div_float" style="display:none;">
                        <table width="750" border="0" cellspacing="4" class="formlayout_table">
                            <tr>
                                <th width="190"><label>Minimum Value:</label></th>
                                <td width="543">${question.minResponseValue}</td>
                            </tr>
                            <tr>
                                <th><label>Maximum Value:</label></th>
                                <td>${question.maxResponseValue}</td>
                            </tr>
                            <tr>
                                <th><label>Significant Digits:</label></th>
                                <td>${question.maxResponses}</td>
                            </tr>
                            <tr>
                                <th><label>Units:</label></th>
                                <td>
                                    ${units}
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="div_int" style="display:none;">
                        <table width="750" border="0" cellspacing="4" class="formlayout_table">
                            <tr>
                                <th width="190"><label>Minimum Value:</label></th>
                                <td width="543">${question.minResponseValue}</td>
                            </tr>
                            <tr>
                                <th><label>Maximum Value:</label></th>
                                <td>${question.maxResponseValue}</td>
                            </tr>
                            <tr>
                                <th><label>Units:</label></th>
                                <td>
                                    ${units}
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="div_date" style="display:none;">
                        <table width="750" border="0" cellspacing="4" class="formlayout_table">
                            <tr>
                                <th width="190"><label>Minimum Value:</label></th>
                                <td width="543">${question.minResponseValue}</td>
                            </tr>
                            <tr>
                                <th><label>Maximum Value:</label></th>
                                <td>${question.maxResponseValue}</td>
                            </tr>
                        </table>
                    </div>
                </div>

                <ul class="functions1">
                    <li>
                        <a href="#" onclick="retireAction('submit');"><img src="<%=request.getContextPath()%>/images/btn/functions1/btn_save.gif"
                                                                               width="122" height="23" class="btn" />
                        </a>
                    </li>
                    <li>
                        <a href="#" onclick="retireAction('SUBMIT_AND_EXIT');"><img src="<%=request.getContextPath()%>/images/btn/functions1/btn_save_exit.gif"
                                                                                        width="122" height="23" class="btn" />
                        </a>
                    </li>
                    <li>
                        <a href="list.html?from=cancel&checkSearch=list"><img src="<%=request.getContextPath()%>/images/btn/functions1/btn_cancel.gif"
                                                                 alt="" width="122" height="23" class="btn" />
                        </a>
                    </li>
                </ul>

                <div class="corners_bottom"></div>
            </div>
            <div class="message">
                ${message}<br>
                <font color="red">
                    ${questionerror}
                </font>
            </div>
        </div>
    </div>
    <!--END: conent -->
</body>
